import request from '../utlis/request'

// 用户登录信息
export const getUserList = () => {
    return request.get('./userlist')
}

// 注册
export const addUser = (data) => {
    return request.post('./userlist', data)
}


// 用户登录注册信息
export const getUserInfor = () => {
    return request.get('./userInfor')
}

//新增用户登录注册信息
export const addUserInfor = (data) => {
    return request.post('./userInfor', data)
}





// 获取首页数据
export const getHomeList = () => {
    return request.get('./homeList')
}


////////////1
// 获取线索管理数据
export const getClueList = () => {
    return request.get('./clueList')
}
// 添加线索管理数据
export const postClueList = (i) => {
    request.post('./clueList', i)
    getClueList()
}

//编辑线索获取
export const getChaClueList = (id) => {
    return request.get(`./clueList?id=${id}`)
}

//删除线索
export const deleteChaClueList = (id) => {
    request.delete(`./clueList/${id}`)
}


//活动
export const getTableData = () => {
    return request.get('./tableData')
}


// 添加活动
export const postTableData = (i) => {
    request.post('./tableData', i)
    getClueList()
}

// 删除活动
export const deleteTableData = (id) => {
    request.delete(`./tableData/${id}`)
    getTableData()
}

//编辑活动获取
export const getChaTableData = (id) => {
    return request.get(`./tableData?id=${id}`)
}




////////////////2
// 获取客户管理数据
export const getManageListTotal = () => {
    return request.get('./managelist')
}

export function getManageList(query) {
    return request({
        url: '/managelist',
        params: {
            ...query,
        }
    })
}

//增加客户管理数据
export const addManageList = (data) => {
    return request.post('./managelist', data)
}

// 删除客户内容
export const delManageList = (data) => {
    return request.delete(`/managelist/${data.id}`, data)
}

// 编辑客户内容
export const editManageList = (data) => {
    return request.patch(`/managelist/${data.id}`, data)
}








//////////////////////////3
// 获取渠道管理数据
export const getchannelList = () => {
    return request.get('./channelList')
}
//添加渠道管理数据
export const postchannelList = (i) => {
    return request.post('./channelList', i)
}
// 编辑客户内容
export const patchchannelList = (data) => {
    return request.patch(`/channelList/${data.id}`, data)
}
// 获取车辆管理数据
export const getCarList = () => {
    return request.get('./carList')
}
// 获取排队库管理数据
export const getlineList = () => {
    return request.get('./lineList')
}

export const getContractList = () => {
    return request.get('./contractList')
}


////////////////5

// 获取合同管理数据
// export const getContractList = () => {
//     return request.get('./contractList')
// }

// 获取客户数据
export function getOrderList(query) {
    return request({
        url: '/orderList',
        params: {
            ...query,
        }
    })
}
// 新增客户
export const addOrderList = (data) => {
    return request.post('./orderList', data)
}
// 编辑客户内容
export const editOrderList = (data) => {
    return request.patch(`/orderList/${data.id}`, data)
}
// 删除客户内容
export const delOrderList = (data) => {
    return request.delete(`/orderList/${data.id}`, data)
}
// 添加流水账
export const addOrderDetails = (data) => {
    return request.post('./orderList', data)
}

// //渠道管理
// export const getQudao = () => {
//     return request.get('./options')
// }


